using System.Configuration;
using System.Reflection;
using ICacheDependency;

namespace CacheDependencyFactory
{
    public static class DependencyAccess
    {


        private static IProductionCacheDependency LoadInstance(string className)
        {

            string path = ConfigurationManager.AppSettings["CacheDependencyAssembly"];
            string fullyQualifiedClass = path + "." + className;

            // Using the evidence given in the config file load the appropriate assembly and class
            return (IProductionCacheDependency)Assembly.Load(path).CreateInstance(fullyQualifiedClass);
        }
    }
}
